There has been known a terminal device having a function for automatically rotating a screen image displayed on a display unit in accordance with the posture (inclination) of the terminal device (for example, Patent Literature 1). In such a terminal device, for example, when user U holds the terminal device T in a vertical state, as shown in FIG. 11 (in other words, a state in which the terminal device T looks long in the vertical direction when seen from user U), the orientation of the screen image is set parallel to the longitudinal direction of the terminal device T, as shown in FIG. 12. Moreover, for example, when user U changes the holding position of the terminal device T and holds the terminal device T in a horizontal state, as shown in FIG. 13 (in other words, a state in which the terminal device T looks long in the horizontal direction when seen from user U), the screen image rotates whereby the orientation of the screen image is set parallel to the shorter side direction of the terminal device T, as shown in FIG. 14.